<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!--标准mui.css-->
		<link rel="stylesheet" href="../css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="../css/app.css" />
		<style>
			h5 {
				margin: 10px;
			}
			
			.mui-badge {
				margin: 10px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">奖池信息</h1>
		</header>
		<div class="mui-content">
			<div class="mui-content-padded">
				<h5>当前奖池金币</h5>
				<div id="away_pool">
					<!--<span class="mui-badge mui-badge-primary">12</span>-->
					<!--<span class="mui-badge mui-badge-success">123</span>
					<span class="mui-badge mui-badge-warning">3</span>
					<span class="mui-badge mui-badge-danger">45</span>
					<span class="mui-badge mui-badge-purple">456</span>-->
				</div>

				<h5>当前抽水收入</h5>
				<div id="consume_gold">
					<!--<span class="mui-badge mui-badge-inverted">1</span>-->
					<!--<span class="mui-badge mui-badge-primary mui-badge-inverted">2</span>
					<span class="mui-badge mui-badge-success mui-badge-inverted">3</span>
					<span class="mui-badge mui-badge-warning mui-badge-inverted">4</span>
					<span class="mui-badge mui-badge-danger mui-badge-inverted">5</span>
					<span class="mui-badge mui-badge-royal mui-badge-inverted">6</span>-->
				</div>

				<h5>当前已开轮数</h5>
				<div id="cur_round">
					<!--<span class="mui-badge mui-badge-primary">12</span>-->
					<!--<span class="mui-badge mui-badge-success">123</span>
					<span class="mui-badge mui-badge-warning">3</span>
					<span class="mui-badge mui-badge-danger">45</span>
					<span class="mui-badge mui-badge-purple">456</span>-->
				</div>
			</div>
		</div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script src="../js/utils/httpUtils.js"></script>
	<script>
		mui.init({
			swipeBack: true //启用右滑关闭功能
		});

		mui.ready(function() {
			var http_utils = new HttpUtils(mui.os.plus);
			var away_pool_show= document.getElementById("away_pool");
			var consume_gold_show = document.getElementById("consume_gold");
			var cur_round_show = document.getElementById("cur_round");
			var url  = "wxhh/get_away_pool_info";
			var successCallback = function(response) {
				//{"cur_award_pool": 26714520, "cur_round_id": 108052, "all_consume_gold": 123625340}
				cur_award_pool = response.cur_award_pool
				all_consume_gold = response.all_consume_gold
				cur_round_id = response.cur_round_id
					// 奖池
				var span = document.createElement('span');
				if (1000000 > parseInt(cur_award_pool)) {
					span.className = "mui-badge mui-badge-danger";
				} else if (50000000 < parseInt(cur_award_pool)) {
					span.className = "mui-badge mui-badge-warning";
				} else {
					span.className = "mui-badge mui-badge-success";
				}
				span.innerHTML = cur_award_pool;
				away_pool_show.appendChild(span);
				//抽水
				var span1 = document.createElement('span');
				span1.className = "mui-badge mui-badge-success mui-badge-inverted";
				span1.innerHTML = all_consume_gold;
				consume_gold_show.appendChild(span1);
				//开奖轮数
				var span2 = document.createElement('span');
				span2.className = "mui-badge mui-badge-primary";
				span2.innerHTML = cur_round_id;
				cur_round_show.appendChild(span2);
			}
			http_utils.get(url,{}, successCallback, http_utils.errorCB);
		});
	</script>

</html>